package com.tt.cards.Company.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


import java.util.Date;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

@Entity
@Table(name="COMPANYPARAMETERS")
public class CompanyParameter implements Serializable{
    
    private static final long serialVersionUID = 1L;
	
    @Id @GeneratedValue
    @Column(name="ID")
    private Long id;
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="RECORDDATE", nullable=false)
    private Date recordDate;
    @Column(name="LEGALADDRESS")
    private String legalAddress;
    @Column(name="POSTADDRESS")
    private String postAddress;
    @Column(name="HEADPOSITIONNAME")
    private String headPositionName;
    @Column(name="HEAD")
    private String head;
    @Column(name="MAINACCOUNTER")
    private String mainAccounter;	
    @Column(name="PHONES")
    private String phones;
    @ManyToOne
    @JoinColumn(name="COMPANYID")
    private Company company;

    public Company getCompany() {
        return company;
    }

    public void setCompany(Company company) {
        this.company = company;
    }

    public String getHead() {
        return head;
    }

    public void setHead(String head) {
        this.head = head;
    }

    public String getHeadPositionName() {
        return headPositionName;
    }

    public void setHeadPositionName(String headPositionName) {
        this.headPositionName = headPositionName;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLegalAddress() {
        return legalAddress;
    }

    public void setLegalAddress(String legalAddress) {
        this.legalAddress = legalAddress;
    }

    public String getMainAccounter() {
        return mainAccounter;
    }

    public void setMainAccounter(String mainAccounter) {
        this.mainAccounter = mainAccounter;
    }

    public String getPhones() {
        return phones;
    }

    public void setPhones(String phones) {
        this.phones = phones;
    }

    public String getPostAddress() {
        return postAddress;
    }

    public void setPostAddress(String postAddress) {
        this.postAddress = postAddress;
    }

    public Date getRecordDate() {
        return recordDate;
    }

    public void setRecordDate(Date recordDate) {
        this.recordDate = recordDate;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Company)) {
            return false;
        }
        CompanyParameter other = (CompanyParameter) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return recordDate.toString();
    }


}
